import Vue from "vue";
import api from "./api";
import App from "./App.vue";
import store from "./store";
import router from "./router/routers";
import emoji from "@/utils/emoji_convert";

// 引入css样式
import "./assets/css/mavon/androidstudio.min.css";
import "./assets/css/mavon/github-markdown.min.css";
import "./assets/css/mavon/katex.min.css";
import "./assets/css/bootstrap/bootstrap.min.css";

// import routes
import "@/router/index"; // import router options files

// import plugin
import "@/plugins";

// import filter and global components
import "@/filter";
import "@/components";

import ElementUI from "element-ui";
import "element-ui/lib/theme-chalk/index.css"; // 样式文件
Vue.use(ElementUI, {
  size: "small", // set element-ui default options
});

Vue.config.productionTip = false;

new Vue({
  render: (h) => h(App),
  router,
  store,
  beforeCreate() {
    Vue.prototype.$bus = this; // 安装全局事件总线，$bus就是当前应用的vm
    Vue.prototype.$api = api;
    Vue.prototype.$win = (msg, str = "success") => {
      return this.$message({
        // 默认内容为 200 状态码内容，进行成功弹窗
        message: msg,
        type: str,
        duration: 5 * 1000,
        offset: 80,
      });
    };
    Vue.prototype.$emoji = emoji;
  },
}).$mount("#app");
